package com.Jeu;


import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

public class HighScore extends Activity {
	public static int defScore = 0;
	private SharedPreferences pref;
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.highscore);
		pref = getSharedPreferences(Options.PREF_FILE, MODE_PRIVATE);
		TextView textView = (TextView) findViewById(R.id.scoreText);
		
	//	textView.setText(""+pref.getLong("score1", defScore));
		
		String chaine = "";
		for(int i = 0 ; i < 5 ; i++)
		{
			 String x_score = "score" + (i+1);
			 String x_name = "name_score"+ (i + 1); 
			
			 long score = 0;
			 String name = "";
			 try
			 {
				 pref.getLong(x_score, score);
				 pref.getString(x_name, name);				 
				 chaine += pref.getString(x_name, name) + " : " + pref.getLong(x_score, score) + "\n"; 
			 }
		 	 catch(Exception e)
		 	 {
		 		chaine += "- : -" + "\n";
		 	 }
			
		}
		
		Toast.makeText( HighScore.this,chaine, Toast.LENGTH_SHORT).show();
		 
	}
}